Compiler-assisted Code Randomization
نویسندگان
چکیده
Despite decades of research on software diversification, only address space layout randomization has seen widespread adoption. Code randomization, an effective defense against return-oriented programming exploits, has remained an academic exercise mainly due to i) the lack of a transparent and streamlined deployment model that does not disrupt existing software distribution norms, and ii) the inherent incompatibility of program variants with error reporting, whitelisting, patching, and other operations that rely on code uniformity. In this work we present compiler-assisted code randomization (CCR), a hybrid approach that relies on compiler–rewriter cooperation to enable fast and robust fine-grained code randomization on end-user systems, while maintaining compatibility with existing software distribution models. The main concept behind CCR is to augment binaries with a minimal set of transformationassisting metadata, which i) facilitate rapid fine-grained code transformation at installation or load time, and ii) form the basis for reversing any applied code transformation when needed, to maintain compatibility with existing mechanisms that rely on referencing the original code. We have implemented a prototype of this approach by extending the LLVM compiler toolchain, and developing a simple binary rewriter that leverages the embedded metadata to generate randomized variants using basic block reordering. The results of our experimental evaluation demonstrate the feasibility and practicality of CCR, as on average it incurs a modest file size increase of 11.46% and a negligible runtime overhead of 0.28%, while it is compatible with link-time optimization and control flow integrity.
منابع مشابه
On the Role of Randomization in Software Engineering
Randomization is defined to mean the removal of redundancy from information. In this sense, it is synonymous with information compression; although, randomization may extend beyond syntactic representation to include domain-specific semantic elements as well. This paper serves to make clear the ubiquitous role assumed by randomization in all aspects of software engineering – from programming la...
متن کاملReturn to Where? You Can’t Exploit What You Can’t Find
So far, no countermeasure has been able to fully prevent sophisticated exploitation techniques such as return-oriented programming (ROP). Recent control-flow integrity (CFI) defenses from Google and Microsoft can be bypassed by constructing a ROP payload that adheres to the control-flow constraints or by exploiting implementation flaws to bypass the control-flow checks. Microsoft’s EMET has les...
متن کاملReverse Stack Execution
Introducing variability during program execution is an effective technique for fighting software monoculture which enables the quick spread of malicious code such as viruses and worms. Existing works in the area of automatic generation of execution variability have been limited to instruction randomization and heap allocation randomization, even though stack overflows are the predominant attack...
متن کاملCompiler-Assisted Multiple Instruction Retry
This paper describes a compiler-assisted approach to providing multiple instruction rollback capability for general purpose processor registers. The objective is achieved by having the compiler remove all forms of N -instruction anti-dependencies. Pseudo register anti-dependencies are removed by loop protection, node splitting, and loop expansion techniques; machine register antidependencies ar...
متن کاملInstantly Obsoleting the Address-code Associations: A New Principle for Defending Advanced Code Reuse Attack
Fine-grained Address Space Randomization has been considered as an effective protection against code reuse attacks such as ROP/JOP. However, it only employs a one-time randomization, and such a limitation has been exploited by recent just-in-time ROP and side channel ROP, which collect gadgets on-the-fly and dynamically compile them for malicious purposes. To defeat these advanced code reuse at...
متن کامل